home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
cafead1a
/
cafe.frm
< prev
next >
Wrap
Text File
|
1999-10-06
|
11KB
|
345 lines
VERSION 4.00
Begin VB.Form Cafe
BackColor = &H00000000&
BorderStyle = 0 'None
ClientHeight = 6945
ClientLeft = 0
ClientTop = 375
ClientWidth = 9660
ClipControls = 0 'False
ControlBox = 0 'False
Height = 7380
Icon = "Cafe.frx":0000
Left = -60
LinkTopic = "Cafe"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 9200
ScaleMode = 0 'User
ScaleWidth = 9660
ShowInTaskbar = 0 'False
Top = 0
Width = 9780
WindowState = 2 'Maximized
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 1000
Left = 7110
Top = 4305
End
Begin VB.TextBox txtTime
Height = 360
Left = 5265
Locked = -1 'True
TabIndex = 7
Top = 3120
Visible = 0 'False
Width = 1815
End
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 60000
Left = 6315
Top = 4290
End
Begin VB.CommandButton cmdLogOn
Caption = "Log On"
Height = 360
Left = 2670
TabIndex = 6
Top = 3120
Visible = 0 'False
Width = 915
End
Begin VB.TextBox txtPass
Height = 360
Left = 3975
PasswordChar = "*"
TabIndex = 5
Top = 3120
Width = 1020
End
Begin VB.Label Label6
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Click Here To Log Off"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Nuptial BT"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 3075
TabIndex = 8
Top = 5580
Visible = 0 'False
Width = 3315
End
Begin VB.Label Label5
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = " Or Click Here To Play Games Offline"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Nuptial BT"
Size = 14.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 615
Left = 2970
TabIndex = 4
Top = 4560
Visible = 0 'False
Width = 3225
End
Begin VB.Label Label4
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = " Password Correct Click Here To Connect"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Nuptial BT"
Size = 15.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 780
Left = 2970
TabIndex = 3
Top = 3630
Visible = 0 'False
Width = 3300
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "To Connect To The Internet Enter Your Password"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 1155
Left = 1110
TabIndex = 2
Top = 1920
Width = 7305
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Welcome To"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Nuptial BT"
Size = 36
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFC0FF&
Height = 810
Left = 2145
TabIndex = 1
Top = 75
Width = 4860
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "Internet Cafe"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Nuptial BT"
Size = 72
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 1560
Left = 465
TabIndex = 0
Top = 465
Width = 8190
End
End
Attribute VB_Name = "Cafe"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdLogOn_Click()
Dim strResult As String * 60 'no variable length strings allowed
Dim lngResult As Long
Dim strFileName As String
strFileName = App.Path & "\Passwords.ini"
On Error GoTo Err
If txtPass.Text = "" Then Exit Sub 'must type something
lngResult = GetPrivateProfileString("Passwords", _
txtPass.Text, strFileName, strResult, Len(strResult), _
strFileName)
txtTime.Text = Trim(strResult)
If Len(txtTime.Text) > 3 Then '999 minute limit
'a longer return string means there was no entry and
'a filename was returned
MsgBox "Password is invalid."
txtPass.Text = "" 'reset
txtPass.SetFocus 'get cursor back to textbox
cmdLogOn.Visible = False
ElseIf txtTime.Text = "0" Then
MsgBox "Time has expired on this password."
txtPass.Text = ""
txtPass.SetFocus
Else
MsgBox "Remember to Log Off when finished or your time will continue. Please close all programs before you Log Off or time expires."
Timer2.Enabled = False 'turn everything on for user
cmdLogOn.Visible = False
Label4.Visible = True
Label5.Visible = True
Label6.Visible = True
Timer1.Enabled = True
txtTime.Visible = True
txtPass.Visible = False
txtTime.Text = txtTime.Text & " minutes remaining."
End If
Exit Sub
Err:
MsgBox "Error"
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
KeyLog KeyCode, Shift 'this is for the admin password only
End Sub
Private Sub Form_Load()
AdjustForm Me
DisableKeys True 'comment out for safety
TaskBar False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = True
End Sub
Private Sub Form_Resize()
FormResize Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
DisableKeys False
End